package com.ten.course.factory;

import com.ten.common.core.vo.Result;
import com.ten.course.fegin.TbMemberFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TbMemberFeignFactory implements FallbackFactory<TbMemberFeign> {
    @Override
    public TbMemberFeign create(Throwable throwable) {
        return mobile -> {
            log.error("会员微服务故障" + throwable.getMessage());
            return new Result<>(500, "会员微服务故障");
        };
    }

}